﻿@{
    ViewBag.Title = "Home Page";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script>
    $(document).ready(function () {
            new Vue({
                el: '#app',
                data: {
                    message: '@Html.Raw(ViewBag.Test)',
                    backstr: '@Html.Raw(ViewBag.backstr)',
                    users: []
                },
                mounted() {
                    this.p_GetEmployeeDatas();
                },
                methods: {
                   p_GetEmployeeDatas: function() {
                        var _self = this;
                        var para = {
                            params: {
                                keyword: "",
                                ksid: 0,
                                zwid: 0,
                                pageIndex: 1,
                                pageSize: 200
                            }
                        }
                        $.showloading();
                        axios.get('@Url.Action("GetJiaoZhiGongs", "KaoHeBanWei")', para).then(
                            function(response) {
                                _self.users = [];
                                debugger;
                                for (var i = 0; i < response.data.data.length; i++) {
                                    _self.users.push(response.data.data[i]);
                                }
                                $.closeloading();
                            },
                            function(response) {
                                alert(response.status);
                            }
                        )
                        .catch(
                            function(error) {
                                alert(error);
                            }
                        );
                }
            }
        });
    });
</script>
<div id="app">
    <h4>{{ message }}</h4>
    @*<button class="btn default">已阅</button>*@
</div>